package KTP;

import java.io.File;
import java.io.FilenameFilter;

public class Lx01 {
    public static void main(String[] args) {
        String pathname = "e:" + File.separator;
        File file = new File(pathname);
        String[] s = file.list(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith(".txt");
            }
        });
        for (int i = 0; i < s.length; i++) {
            System.out.println(s[i]);
        }
    }
}
